package com.wheat.web.controller;

import com.wheat.common.result.RestfulCode;
import com.wheat.common.result.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wheat on 2019/12/4.
 */
@RestController
@RequestMapping("/test")
@RefreshScope
public class TestController {

    @Value("${test.refresh}")
    private String str;

    //@GetMapping("/refresh")
    //public String tettRefresh() {
    //    return str;
    //}

    @GetMapping("/refresh")
    public Result tettRefresh() {
        return Result.success();
    }

    @GetMapping("/refresh2")
    public Result tettRefresh2() {

        return Result.success(RestfulCode.SUCCESS, str);
    }

}
